<?php
// +----------------------------------------------------------------------
// | Author: yaoyihong <510974211@qq.com>
// +----------------------------------------------------------------------

namespace app\common\validate;

/**
 * 基础验证器
 */
class UserAddress extends ValidateBase
{
	// 验证规则
    protected $rule = [
        'consignee'       => 'require',
        'mobile'          => 'require|length:11,11',
        'address'         => 'require|length:1,150'
    ];

    // 验证提示
    protected $message = [
        'consignee.require'    => '收货人姓名必须',
        'mobile.require'        => '手机号码必须',
        'mobile.length'     => '手机号码11位',
        'address.require'    => '收货地址不能为空',
        'address.length'     => '收货地址过长',
    ];

    // 应用场景
    protected $scene = [
        'opaddress'  =>  ['consignee','mobile','address'],
    ];
}
